package org.jeecg.controller;

import org.jeecg.domain.dto.InstStaffDto;
import org.jeecg.domain.po.InstitutionStaff;
import org.jeecg.service.InstitutionStaffService;
import org.jeecg.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/InstitutionStaff")
public class InstitutionStaffController {
    @Autowired
    private InstitutionStaffService institutionStaffService;
//    查询所有
    @GetMapping("/findAll")
    public List<InstitutionStaff> findAll(){
        return institutionStaffService.list();
    }
//    查询所有（分页）+条件：1、姓名2、电话
    @GetMapping("/findPage")
    public ResponseResult findPage(InstStaffDto dto){
        return institutionStaffService.findPage(dto);
    }
//    删除逻辑删除
    @GetMapping("/removeById")
    public ResponseResult deleteById(@RequestParam("id") String id){
        return institutionStaffService.deleteById(id);
    }

}
